package com.dlyk.mapper;

import com.dlyk.bean.TUser;
import com.dlyk.common.DataScope;
import com.dlyk.query.BaseQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TUser record);

    int insertSelective(TUser record);

    TUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TUser record);

    int updateByPrimaryKey(TUser record);

    TUser selectByUsername(String username);

    /**
     * 用户分页查询
     * @return
     */
    @DataScope(tableAlias = "tu",tableFiled = "id")
    List<TUser> selectByUserPage(BaseQuery baseQuery);

    /**
     * 根据id查询用户信息
     * @param id
     * @return
     */
    TUser selectDetailById(Integer id);

    /**
     * 批量删除用户
     * @param list
     * @return
     */
    int batchDelUser(List<String> list);

    /**
     * 查询负责人
     * @return
     */
    List<TUser> selectOwner();

}